<template>
  <div class="login-container">
    <!-- 登录头部 -->
    <van-nav-bar
    class="app-nav-bar"
  title="登录/注册"
  left-text="返回"
  right-text="注册"
  left-arrow
  @click-left="$router.back()"
/>

<!-- 登录表单 -->
<van-cell-group>
  <van-field
    v-model="user.mobile"
    
    left-icon="smile-o"
    placeholder="请输入手机号"
  />
  <van-field
    v-model="user.code"
    clearable
   
    left-icon="music-o"
    placeholder="请输入验证码"
  >
    <template #button>
    <van-button 
    size="small" 
    type="primary">发送验证码</van-button>
  </template>
</van-field>
</van-cell-group>

<div class="login-btn-wrap">
<van-button class="login-btn" 
type="primary" 
size="large"
@click="onlogin"
>登录</van-button>
  </div>
  </div>
</template>


<script>
// 加载调用登录注册接口
// import{login}from '@/api/user'

export default {
  name: "loginIndex",

  components: {},
  props: {},

  data() {
    return {
      user:{
        mobile:'',//手机号
        code:'',//验证码
      }
    };
  },
  computed: {},
  watch: {},
  created() {},

  mounted() {},

  methods: {
    onlogin(){
      //找到数据接口
      //封装请求方法
      //请求调用登录
      
    //      const res=await login(this.user)
    //  console.log(res);
   
   
      //处理响应结果
    }
  }
}
</script>

<style lang="stylus" scoped>
.login-container{
 
  .login-btn-wrap{
    padding 2rem
    
  }
}

 
</style>